<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Data-Table 表格</title>
    <link rel="stylesheet" href="../../frame/layui/css/layui.css">
    <link rel="stylesheet" href="../../frame/static/css/style.css">
    <link rel="stylesheet" href="../../css/common.css">
    <link rel="stylesheet" href="../../css/message/list.css">
	<style>
      td{
      	overflow: hidden;
		text-overflow:ellipsis;
      }
    </style> 
</head>
<body class="body">
<!-- 工具集 -->
<div class="my-btn-box">
    <span class="fl">
        <a class="layui-btn btn-add btn-default" id="btn-refresh" onclick="location.reload()"><i class="layui-icon">&#x1002;</i></a>
    </span>
    <!--<span class="fr">-->
    <!--<span class="layui-form-label">搜索条件：</span>-->
    <!--<div class="layui-input-inline" >-->
    <!--<input type="text" autocomplete="off" value="" placeholder="输入消息内容"  class="layui-input search" name="content">-->
    <!--</div>-->
    <!--<a class="layui-btn mgl-20" id="search">查询</a>-->
    <!--</span>-->
</div>

<!-- 表格 -->
<div class="dateTable">
    <div class="table-title">
      	<div style="width: 20%">标题</div>
        <div style="width: 55%">消息内容</div>
      	
        <div style="width: 20%">创建时间</div>
    </div>
    <table class="data-table" id="data-table">
    </table>
    <div id="pagebox">

    </div>
</div>

<script src="../../js/public/jquery-3.1.1.min.js"></script>
<script src="../../js/layer/layer.js"></script>
<script src="../../js/public/common.js"></script>
<script>
  	$(function(){
    GetList();

});
function GetList(){
    let page = GetQueryString('page');
    if(!page)page=1;  	
    let data = AjaxForm('admin/msglist?page='+page);
    let html = ``;
    for (let i=0;i<data.list.length;i++){
        let time = formatDateTime(data.list[i].create_time);
        html += `<tr class="table-content" style='height: 50px;'>
					<td style="width: 20%">${data.list[i].title}</td>
                    <td style="width: 55%">${data.list[i].content}</td>
                    <td style="width: 20%">${time}</td>
                `;
    }
    $('#data-table').html(html);
    WepPage(data.count,page,'list');
}
  
  </script>
</body>
</html>